Repository navigation
feat: adapt to ds-bot 0.3.x (settings-page switch) + top-bar ADE entry + stealth switching - #2
Merged
Conversation
…0.4.3) - ds-bot 0.3.x moved 'Classic Agent mode' from the account menu into Bot settings -> General; rewire the Bot<->Classic path to the settings page, matching menu items/buttons by text. Removes the old 'last menu item' fallback that clicked 'Sign in to DeepSeek' and opened the login page. - Add a top-bar 'ADE' entry (.bt-side-top, narrow rail -> .bt-rail-top). - Stealth mode: hide account menu / settings layer during automation, restore after. - Fallback: write localStorage['ds-bot:surface'] and reload if DOM paths fail. - Bump to 0.4.3; compatibility records 0.2.1-rc.4 and 0.2.2-rc.1.
Closed
Match the hotkey on the physical key (event.code === KeyB) instead of the character it produces: on macOS Option is a character modifier and Option+Shift+B reports key "ı", so the old `event.key === "b"` check never fired there and the shortcut only worked on Windows. - macOS additionally accepts Cmd+Shift+B. - Tooltips name the platform's own modifiers (⌥⇧B / ⌘⇧B on macOS, Alt+Shift+B elsewhere). - Auto-repeat and IME-composing key events are ignored. - Smoke tests cover the Windows, macOS and no-`code` fallback paths.
|
独立验证一下这个 PR 的核心修复(与作者无关联,不同环境):
结论:0.3.x 适配部分有效,支持合并。顶栏入口与 mac 热键修复未单独验证,仅供参考。 |
Owner
|
感谢实现,方向完全正确。已合并进 main(merge commit d4aa212,保留你两个 commit 与署名),并随 v0.4.4 发布:https://github.com/JackWoods-code/dsh-bot-toggle/releases/tag/v0.4.4 合并后在 main 上做了一处 fix-forward(434813c):
验证:
另外说明一下:fork 首次贡献的 CI 需要维护者手动批准,之前那两次 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
ds-bot 升级到 0.3.1 后,旧的切换逻辑失效:
client.js设置页)。改动
1. 适配 ds-bot 0.3.x(修复切换)
2. 顶栏大入口
.bt-side-top,窄栏回退.bt-rail-top)注入「ADE」按钮,一键切换;被 React 重渲染清掉后由 500ms 刷新自动补回。3. 无闪烁切换(隐身模式)
display:none(元素留在 DOM 里,程序化点击照常生效),切换后 400ms 恢复;失败时补发 Escape 收起残留弹层。4. 最终兜底
localStorage["ds-bot:surface"]后刷新页面(ds-bot 启动时读取)。5. 版本与兼容表
version0.4.1 → 0.4.3dsh.compatibility.dshReleases补记0.2.1-rc.4、0.2.2-rc.1更新(0.4.4):快捷键在 macOS 上不可用 — 已修复
根因:keydown 判定用的是
event.key === "b"/"B"+altKey&&shiftKey。macOS 上 Option 是字符修饰键,⌥⇧B 产生的event.key是ı(不是 b/B),所以 macOS 上热键永远不触发;Windows 的 Alt 不改写字符,因此只有 Windows 生效。修法:
event.code === "KeyB"(与键盘布局、修饰键产出的字符无关);无code的环境回退到字符表{ b, B, ı, ∫ }。shiftKey必须;(altKey || (IS_MAC && metaKey));排除ctrlKey;忽略repeat与isComposing(输入法期间不触发)。IS_MAC(userAgentData / navigator.platform / userAgent);提示文案按平台显示 ⌥⇧B / ⌘⇧B(mac)或 Alt+Shift+B(Win/Linux),共 6 处 tip 与 1 处 log;README/README.zh 同步。package.json0.4.3 → 0.4.4,CHANGELOG 增补。测试:
node --test7 用例(原 5 + 新 2:Windows 组合矩阵 8 断言;mac 的 ⌥⇧Bkey=ı、⌘⇧B、无 code 回退、文案断言)。node --check通过。改动文件:
lib/client.js、package.json、CHANGELOG.md、test/smoke.mjs、README.md、README.zh.md。